home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Learn Microsoft Visual Basic 6.0 Now
/
Learn Microsoft Visual Basic 6.0 Now (Microsoft Press)(X03-58607)(1998).ISO
/
media
/
chap09
/
b09w005.cc2
< prev
next >
Wrap
Text File
|
1998-06-07
|
998b
|
23 lines
0, The AddNameToListBox Sub procedure adds
3, names to a list box. First, the
6, procedure receives the name to be added with the
8, person$ argument, a string variable
10, received by reference during the procedure
12, call. If the value of person$ is not
15, empty, or null, the specified name is added
19, to the List1 list box object with the
21, AddItem method, and a confirming message
24, is displayed by the MsgBox function. If
28, the argument is null, the procedure
30, skips the AddItem method and displays the
32, message, "Name not specified." Note the
37, third line in the Sub procedure, which
38, uses the AddItem method to modify a list
41, box object on Form1 from the standard
44, module. Because the list box is associated
48, with a different file, you need to prefix
51, the object name with Form1 and a
53, period. This long-distance syntax is a little
57, like dialing a country code when you
59, make a long-distance call.
60, END